package com.hunktimes.wholesale.ui.pages

import android.os.Bundle
import android.view.View
import com.hunktimes.wholesale.R
import com.hunktimes.wholesale.base.BasePageFragment
import com.hunktimes.wholesale.databinding.FragmentEditAddressBinding
import com.hunktimes.wholesale.net.model.AddressBundle
import com.hunktimes.wholesale.util.Constants

/**
 * Author: Delete
 * Date: 2020/7/28 17:50
 * Description:
 *
 */
class EditAddressFragment : BasePageFragment(R.layout.fragment_edit_address) {
    override val titleRes: Int
        get() = R.string.title_address_edit

    lateinit var viewBinding: FragmentEditAddressBinding
    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
        viewBinding = FragmentEditAddressBinding.bind(view)
    }

    override fun onStart() {
        super.onStart()
        arguments?.getParcelable<AddressBundle>(Constants.key_address_bundle)?.let {
            viewBinding.receiverTv.setText(it.name)
            viewBinding.addressTv.setText(it.address)
            viewBinding.phoneTv.setText(it.phone)
            viewBinding.areaTv.setText(it.address)
        }
    }
}